// Package __linklist 206_reverse_link
// @Title __linklist
// @Description
// @Author  == 琳琳也叫王木木 ==  2021/9/2 15:02
// @Create  2021/9/2 15:02
package __linklist

// ReverseList 翻转链表
func ReverseList(head *ListNode) *ListNode {
	if head == nil {
		return nil
	}
	var slow *ListNode
	fast := head
	for fast != nil {
		fast = fast.Next
		head.Next = slow
		slow = head
		head = fast
	}
	return slow
}
